package com.easybuilder.core.seo.service.impl;

import com.easybuilder.common.utils.TimeUtil;
import com.easybuilder.core.seo.dao.SysSeoHistoryDao;
import com.easybuilder.core.seo.entity.SysSeoHistory;
import com.easybuilder.core.seo.service.SeoHistoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

@Service
public class SeoHistoryServiceImpl implements SeoHistoryService {

    @Resource
    private SysSeoHistoryDao seoHistoryDao;

    /** 新增一条搜索引擎seo抓取记录 */
    @Override
    public int addSeoHistory(SysSeoHistory history) {

        return seoHistoryDao.insertSelective(history);
    }

    /** 统计记录 */
    @Override
    public List<Integer> countHistory() {

        return seoHistoryDao.countSeoHistory(TimeUtil.getFormatDay(new Date()));
    }
}
